import React, {useEffect, useState} from 'react';
import './index.css'
import http from "../../../util/http";

function Leader() {
    const [leader, setLeader] = useState([]);
    useEffect(() => {
        http.doGet("/model/data/get", {type: "Leader"}).then(res => {
            if (res.status === 200) {
                setLeader(res.data);
            }
        })
    }, []);
    return (
        <div className="portal-leader-main">
            {
                leader && leader.map((item, index) => {
                    return (
                        <div className="portal-leader-item" key={index}>
                            <div className="portal-leader-item-img">
                                <img src={item.img} alt="图片"/>
                            </div>
                            <div className="portal-leader-item-text">
                                <div className="portal-leader-item-text-name">{item.name}</div>
                                <div className="portal-leader-item-text-desc">
                                    <span>{item.ll}</span>
                                </div>
                            </div>
                        </div>
                    )
                })
            }
        </div>
    );
}

export default Leader;